package com.projects.android.adapters;

import android.view.View;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.TextView;

import com.projects.android.R;
import com.projects.android.utils.Utils;

public class FoodViewHolder {
	private View mRow;
	private TextView title = null;
	private TextView detail = null;
	private ImageView i11 = null;
	private ImageButton buy = null;
	
	public FoodViewHolder(View row) {
		mRow = row;
	}

	public TextView gettitle() {
		if (null == title) {
			title = (TextView) mRow.findViewById(R.id.lblFoodName);
			title.getLayoutParams().width = Utils.SCREEN_WIDTH - 125;
		}
		return title;
	}

	public TextView getdetail() {
		if (null == detail) {
			detail = (TextView) mRow.findViewById(R.id.lblFoodPrice);
			detail.getLayoutParams().width = Utils.SCREEN_WIDTH - 125;
		}
		return detail;
	}

	public ImageView getImage() {
		if (null == i11) {
			i11 = (ImageView) mRow.findViewById(R.id.imgFood);
		}
		return i11;
	}

	public ImageButton getImgBuy() {
		if (null == buy) {
			buy = (ImageButton) mRow.findViewById(R.id.btnBuyFood);
			buy.setFocusable(false);
		}
		return buy;
	}


}
